package permission_dal

import (
	"starry_sky/internal/dal"
	"starry_sky/internal/model"
)

// ListPermissionByRole 通过角色获取权限
func ListPermissionByRole(role *model.Role, permissions *[]*model.Permission) error {
	err := dal.DB.Model(&role).Association("Permissions").Find(&permissions)
	if err != nil {
		return err
	}
	return nil
}
